Many USB-interface based products, such as wireless terminal products, high performance Human Interface Device (HID) products, etc., support automatic installation (or referred to as autorun). The automatic installation function is implemented by simulating a virtual compact disc device for the product to allow users to directly install driver in the virtual compact disc instead of using a physical compact disc that comes with the product, as the users did traditionally.
To implement the function, the USB device must be capable of operating in least two modes, i.e., a single compact disc mode (provided for driver installation or other configuration management software installation) and a normal operating mode (provided for a multi-port compound device to implement different port functions). After a user installs the driver of the USB device which is in the single compact disc mode into a PC, the USB device has to be switched to the operating mode to perform various user functions.
As to USB Modem data card products commonly used in the wireless terminal field, they generally adopt a hardware reset policy when performing the port switching operation. Specifically, when a device receives a Small Computer System Interface (SCSI) instruction from the PC, the device would set a corresponding flag file in its flash space, and the flag file, after being setup, performs a whole board reset function. During initialization of the USB module after the whole board resets, the device is enumerated to a compound device multi-port mode (i.e., normal operating mode) by judging the corresponding flag file.
With rapid development of the wireless terminals, more and more mobile operators and user groups have favored WiFi-enabled Ufi data card products. The Ufi data card products have a battery function module which acts as an independent power supply and thus application environments thereof are much more complex than those of the traditional data card products.
The following conditions may occur when the driver of the Ufi data card product is installed into a PC in a traditional autorun manner: the device is switched to the compound device multi-port mode after the driver is installed at the PC in the single compact disc mode; the user pulls the USB cable and plugs the device which is in an ON state and powered by the battery into another PC in which the driver has not ever been installed; at this time, the device has already been in the compound device multi-port mode and thus the PC has enumerated a plurality of ports to which the driver has not ever been installed, and thus none of the ports can function normally. In this case, the driver cannot be installed normally until the user resets the device and the single compact disc re-report enumeration is completed.
From the perspective of user experience, users cannot bear and accept the above instances, and it is necessary for developers to immediately avoid or solve them.